unit UFrmip;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Buttons, ExtCtrls, Grids, DBGrids, StdCtrls, Mask, DBCtrls, ComCtrls;

type
  TFrmip = class(TForm)
    Panel1: TPanel;
    Image1: TImage;
    Label3: TLabel;
    btnGravar: TSpeedButton;
    SpeedButton1: TSpeedButton;
    btnRetornar: TSpeedButton;
    Panel2: TPanel;
    ScrollBox1: TScrollBox;
    Label1: TLabel;
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    DBEdit4: TDBEdit;
    DBEdit3: TDBEdit;
    Label4: TLabel;
    Label2: TLabel;
    DBEdit5: TDBEdit;
    DBEdit6: TDBEdit;
    DBEdit8: TDBEdit;
    DBEdit7: TDBEdit;
    Label5: TLabel;
    Label6: TLabel;
    DBEdit9: TDBEdit;
    DBEdit10: TDBEdit;
    DBEdit12: TDBEdit;
    DBEdit11: TDBEdit;
    Label7: TLabel;
    Label8: TLabel;
    DBEdit13: TDBEdit;
    DBEdit14: TDBEdit;
    Label9: TLabel;
    DBEdit15: TDBEdit;
    DBEdit16: TDBEdit;
    Label10: TLabel;
    DBEdit17: TDBEdit;
    DBEdit18: TDBEdit;
    Label11: TLabel;
    DBEdit19: TDBEdit;
    DBEdit20: TDBEdit;
    Label12: TLabel;
    Label13: TLabel;
    DBEdit21: TDBEdit;
    DBEdit22: TDBEdit;
    DBEdit23: TDBEdit;
    DBEdit24: TDBEdit;
    DBEdit25: TDBEdit;
    DBEdit26: TDBEdit;
    DBEdit27: TDBEdit;
    DBEdit28: TDBEdit;
    DBEdit29: TDBEdit;
    DBEdit30: TDBEdit;
    DBEdit31: TDBEdit;
    DBEdit32: TDBEdit;
    DBEdit33: TDBEdit;
    DBEdit34: TDBEdit;
    DBEdit35: TDBEdit;
    DBEdit36: TDBEdit;
    DBEdit37: TDBEdit;
    DBEdit38: TDBEdit;
    DBEdit39: TDBEdit;
    DBEdit40: TDBEdit;
    Label14: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    Label17: TLabel;
    Label18: TLabel;
    Label19: TLabel;
    Label20: TLabel;
    Label21: TLabel;
    Label22: TLabel;
    Label23: TLabel;
    Label24: TLabel;
    DBEdit41: TDBEdit;
    DBEdit42: TDBEdit;
    DBEdit43: TDBEdit;
    DBEdit44: TDBEdit;
    Label25: TLabel;
    Label26: TLabel;
    DBEdit45: TDBEdit;
    DBEdit46: TDBEdit;
    DBEdit47: TDBEdit;
    DBEdit48: TDBEdit;
    Label27: TLabel;
    StatusBar1: TStatusBar;
    procedure btnRetornarClick(Sender: TObject);
    procedure btnAdicionarClick(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure btnGravarClick(Sender: TObject);
    procedure btnExcluirClick(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    procedure FormShow(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Frmip: TFrmip;

implementation

uses Modulo;

{$R *.DFM}

procedure TFrmip.btnRetornarClick(Sender: TObject);
begin
   close;
end;

procedure TFrmip.btnAdicionarClick(Sender: TObject);
begin
   DMescola.Qip.Append;
end;

procedure TFrmip.SpeedButton1Click(Sender: TObject);
begin
   DMEscola.Qip.Edit;
end;

procedure TFrmip.btnGravarClick(Sender: TObject);
begin
   DMEscola.Qip.Post;
   DMEscola.Qip.Edit;
   Showmessage('informações sobre os computadores gravados com sucesso!');
end;

procedure TFrmip.btnExcluirClick(Sender: TObject);
begin
   DMescola.Qip.Delete;
end;

procedure TFrmip.FormClose(Sender: TObject; var Action: TCloseAction);
begin
   Action := CaFree;
end;

procedure TFrmip.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
   if MessageDlg('A Configuração de computadores e IPs será fechada!'+#13+'Confirmar?', MtConfirmation, [mbyes, mbno], 0) = mrno then
      CanClose := false;
end;

procedure TFrmip.FormShow(Sender: TObject);
begin
   DMEscola.Qip.Edit;
end;

procedure TFrmip.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
   if Key = VK_F10 then
      btngravar.Click;
   if Key = VK_F11 then
      speedbutton1.Click;
   if Key = VK_F12 then
      btnretornar.Click;
end;

end.
